package com.xsprite.managesys.bean;

import com.alibaba.fastjson.JSONObject;

import util.VersionUpdateUtil;

public class QueryRoleInfo {
	private int serverId = -1;
	private long roleid;
	private long userid;
	private String rolename;
	private int level;
	private long logintime;
	private String data;
	private JSONObject dataJson;
	private int force;
	private int shengwang;
	private int rongyu;
	private long yuanBao;
	private String jsonData;
	private String ip;
	
	
	
	public int getServerId() {
		return serverId;
	}

	public void setServerId(int serverId) {
		this.serverId = serverId;
	}

	public JSONObject getDataJson()
	  {
	    return this.dataJson;
	  }

	  public long getYuanBao() {
	    if (this.dataJson == null) return 0L;
	    this.yuanBao = this.dataJson.getInteger("dollar").intValue();
	    return this.yuanBao;
	  }
	  public String getIp() {
	    if (this.dataJson == null) return "";
	    this.ip = this.dataJson.getString("ip");
	    return this.ip;
	  }
	  public long getShengwang() {
	    if (this.dataJson == null) return 0L;
	    this.shengwang = this.dataJson.getInteger("shengwang").intValue();
	    return this.shengwang;
	  }

	  public long getRongyu() {
	    if (this.dataJson == null) return 0L;
	    this.rongyu = this.dataJson.getInteger("rongyu").intValue();
	    return this.rongyu;
	  }
	  public int getForce() {
	    if (this.dataJson == null) return 0;
	    this.force = this.dataJson.getInteger("force").intValue();
	    return this.force;
	  }

	  public long getRoleid() {
	    return this.roleid;
	  }

	  public void setRoleid(long roleid)
	  {
	    this.roleid = roleid;
	  }

	  public long getUserid()
	  {
	    return this.userid;
	  }

	  public void setUserid(long userid)
	  {
	    this.userid = userid;
	  }

	  public int getLevel()
	  {
	    return this.level;
	  }

	  public void setLevel(int level)
	  {
	    this.level = level;
	  }

	  public String getRolename()
	  {
	    return this.rolename;
	  }

	  public void setRolename(String rolename)
	  {
	    this.rolename = rolename;
	  }

	  public long getLogintime()
	  {
	    return this.logintime;
	  }

	  public void setLogintime(long logintime)
	  {
	    this.logintime = logintime;
	  }

	  public String getData()
	  {
	    return this.jsonData;
	  }

	  public void setData(String data)
	  {
	    this.data = data;
	    try {
	      this.jsonData = VersionUpdateUtil.dateLoad(this.data);

	      this.dataJson = JSONObject.parseObject(this.jsonData);
	    }
	    catch (Exception e) {
	      e.printStackTrace();
	    }
	  }
}
